<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%@include file="../userInfo_inc.jsp" %>
<body>
<br>

<h1>修改设计题目</h1>
<c:url var="action" value="/project/updateGraduateProject.html" />
<form:form modelAttribute="graduateProject" action="${action}" method="POST">
	题目名称
	<form:input path="title" />
	<br>
	 题目类别
	<form:select path="projectCategory" items="${categories}"
		itemValue="id" itemLabel="description"  />
	<br>
	题目类型
	<form:select path="projectType" items="${types}" itemValue="id"
			itemLabel="description" />
	<br>
	限选专业
	<form:select path="limitedToMajor" items="${majors}" itemValue="id"
			itemLabel="description" />
	<br>
			
	<input type="submit"/>	
</form:form>
<!--  
	<form action="action/GraduateProjectServlet?action=update&id=${graduateProject.id}" method="post">
	
		题目名称 
		<input name="title" value="${graduateProject.title}"/>
		<br>
		题目类别
		<select name="category" >		
			<c:forEach items="${categories}" var="category" >				
				<option
					${category.id == graduateProject.projectCategory.id ? 'selected' : ''}
				 value="${category.id}" >${category.description}</option>
			</c:forEach>
			
		</select>	
		<br>
		题目类型
		<select name="type">
			<c:forEach items="${types}" var="type">
				<option 
				${type.id == graduateProject.projectType.id ? 'selected' : ''}
				value="${type.id}">${type.description}</option>
			</c:forEach>
		</select>	
		<br>
		限选专业
		<select name="majors" multiple="multiple">
			<c:forEach items="${majors}" var="major">
				<option
					<c:forEach items="${graduateProject.limitedToMajor}" var="selectedMajor">
					 	${major.id==selectedMajor.id ? 'selected':''}					 	
					</c:forEach>
				value="${major.id}"/>${major.description}
			</c:forEach>
		</select>	
		<br>
		<input type="submit" value="修改"/>
	</form>
 -->	
</body>
</html>